package ru.ncedu.java.vlku.hrs.dal.dao;

import ru.ncedu.java.vlku.hrs.dal.dao.impl.DataBaseDAOImpl;

public class DataBaseFactory {

    private static DataBaseDAO dataBaseDAO = null;
    private static DataBaseFactory instance = null;

    private DataBaseFactory() {}
    public static synchronized DataBaseFactory getInstance(){
        if (instance == null){
            instance = new DataBaseFactory();
        }
        return instance;
    }

    public DataBaseDAO getDataBaseDAO(){
        if (dataBaseDAO == null){
            dataBaseDAO = new DataBaseDAOImpl();
        }
        return dataBaseDAO;
    }
}
